package com.rnkrsoft.suyan.config.internal.enums;

import com.rnkrsoft.interfaces.EnumIntegerCode;

/**
 * Created by woate on 2019/5/19.
 */
public enum ProjectStatusEnum implements EnumIntegerCode{
    NORMAL(1, "正常"),
    DELETE(-1, "删除");
    int code;
    String desc;

    ProjectStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static ProjectStatusEnum valueOfCode(int code){
        for (ProjectStatusEnum value : values()){
            if (value.code == code){
                return value;
            }
        }
        throw new IllegalArgumentException("illegal code " + code);
    }
}
